#!/bin/bash
#

while read line; do
     name=$(echo $line | awk -F: '{print $1}')
     password=$(echo $line | awk -F: '{print $2}')
     uid=$(echo $line | awk -F: '{print $3}')
     gid=$(echo $line | awk -F: '{print $4}')
     comment=$(echo $line | awk -F: '{print $5}')
     home_dir=$(echo $line | awk -F: '{print $6}')
     shell=$(echo $line | awk -F: '{print $7}')
     mysql -uroot -pWWW.1.com -e "insert into it.passwd(name,password,uid,gid,comment,home_dir,shell) values('$name','$password',$uid,$gid,'$comment','$home_dir','$shell')"
done < /etc/passwd
